package com.dwxt.cdms.controller.base;

import com.dwxt.cdms.service.AiAoLeDataService;
import com.dwxt.cdms.service.WatchService;
import com.dwxt.common.base.BaseResult;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统维护接口
 *
 * @author Kuang.JiaZhuo
 * @date 2020-09-16 17:24
 */
@RestController
@RequestMapping("/system/maintenance")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class SystemMaintenanceController {

    private final WatchService watchService;
    private final AiAoLeDataService aiAoLeDataService;

    /**
     * @方法名：replaceBindingWatchUser
     * @描述： 更换手表和用户的绑定
     * @作者： kjz
     * @日期： Created in 2020/9/16 17:29
     */
    @RequestMapping("/replaceBindingWatchUser")
    public BaseResult replaceBindingWatchUser(Integer customerId,String deviceIdentity) {
       int result = watchService.replaceBindingWatchUser(customerId,deviceIdentity);
        return  BaseResult.ok(result);
    }

    /**
     * @方法名：replaceBindingAiAoLeUser
     * @描述： 更换爱奥乐设备和用户的绑定
     * @作者： kjz
     * @日期： Created in 2020/9/16 17:47
     */
    @RequestMapping("/replaceBindingAiAoLeUser")
    public BaseResult replaceBindingAiAoLeUser(Integer customerId,String serialNumber) {
        int result = aiAoLeDataService.replaceBindingAiAoLeUser(customerId,serialNumber);
        return  BaseResult.ok(result);
    }
}
